// 打开的路径
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import MyFirstView from '../views/MyFirstView.vue'
import AboutView from '../views/AboutView.vue'
import Shopping from '../views/Shopping.vue'
import LoginView from '../views/LoginView.vue'
import RegisterView from '../views/RegisterView.vue'
import AddressView from '../views/AddressView.vue'
import SaleInfo from '../views/SaleInfo.vue'
import AddAddress from '../views/AddAddress.vue'
import OrderView from '../views/OrderView.vue'



const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView,
    meta:{
      loginNav:true
    }
  },
  {
    path: '/register',
    name: 'register',
    component: RegisterView,
    meta:{
      loginNav:true
    }
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
  },
  {
    path: '/isOrder',
    name: 'isOrder',
    component: OrderView,
    meta:{
      loginNav:true
    }
  },
  {
    path: '/saleinfo:id',
    name: 'saleinfo',
    component: SaleInfo,
    meta:{
      loginNav:true
    }
  },
  {
    path: '/first',
    name: 'MyFirstView',
    component: MyFirstView,
  },
  {
    path: '/about',
    name: 'about',
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/shopping',
    name: 'shopping',
    component:Shopping
  },
  {
    path:'/address',
    name:'address',
    component:AddressView,
    meta:{
      loginNav:true
    }
  },
  {
    path:'/AddAddress',
    name:'AddAddress',
    component:AddAddress,
    meta:{
      loginNav:true
    }
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
